from django.conf import settings
from django.core.files.storage import Storage


class MyfileStorage(Storage):
    def __init__(self, base_url=None):
        if not base_url:
            base_url = settings.BASE_URL
        self.base_url = base_url

    def save(self, name, content, max_length=None):
        pass

    def open(self, name, mode='rb'):
        pass

    def exists(self, name):
        # 返回False表示文件不存在
        return False

    def url(self, name):
        # print('name=%s' % name)
        return self.base_url + name
